import React, { Component } from 'react'
import Son from './Son'

export default class Fahter extends Component {
    state = {
        num: ""
    }
    fn = (num) => {
        this.setState({
            num
        })
    }
    render() {
        const { num } = this.state
        return (
            <div>
                <h2>我是父组件 -- { num } </h2>
                <Son fn = { this.fn }/>
            </div>
        )
    }
}
